const { defineConfig } = require("@vue/cli-service");

const env = process.env.NODE_ENV;
module.exports = defineConfig({
  publicPath: "./",//打包后导入文件和资源的前缀
  lintOnSave: env === "development" ? true : false,
  transpileDependencies: [],
  productionSourceMap: false,
  devServer: {
    host: "127.0.0.1",
    open: true,
    proxy: {
      "/api": {
        target: "https://iot.wumei.live/prod-api",
        changeOrigin: true,
        ws:true,
        pathRewrite: { "^/api": "" },
      },
    },
  },
  chainWebpack: (config) => {
    config.optimization.minimizer('terser')
      .tap(options =>{
        let compress=options[0].terserOptions.compress
        compress.drop_console=true
        compress.drop_debugger=true
        return options
      })
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': require('path').resolve(__dirname, 'src')
      }
    }
  }
});
